<template>
  <div>
    <input type="text" v-model="regInfo.phoneNumber" placeholder="请输入手机号"><br>
    <div>
      <input type="text" v-model="regInfo.validCode" placeholder="请输入短信验证码"><br>
      <span class="code">获取验证码</span>
    </div>
    <input type="text" v-model="regInfo.password" placeholder="请输入6-12位密码"><br>
    <label for="provision">
      <input id="provision" type="checkbox" v-model="regInfo.isAgree" class="check" >
      <span></span>
      我已阅读并同意<span>《商城销售合同》</span>
    </label>
    <button @click="register">注册</button>
  </div>
</template>

<script>
/* eslint-disable import/newline-after-import,arrow-parens,no-console */

// import axios from 'axios';
// import http from '../http';
export default {
  name: 'register',
  data() {
    return {
      regInfo: {
        phoneNumber: '',
        validCode: '',
        password: '',
        isAgree: true,
      },
    };
  },
  methods: {
    register() {
      this.$apis.register(this.regInfo)
        .then(data => {
          console.log(data);
        })
        .catch(error => {
          console.log(error);
        });
    },
  },
};
</script>

<style lang="scss" scoped>
  @function rem($px,$unit:75){
    @return $px/$unit#{rem}
  }
  input{
    margin:0 8%;
    height:rem(101);
    border:none;
    border-bottom: 1px solid #ddd;
    outline: none;
    padding-left: 4%;
    width:84%;
    font-size: rem(27);
    box-sizing: border-box;
    position: relative;
  }
  .code{
    color:#3d9dfc ;
    font-size: rem(27);
    position: absolute;
    top:rem(601);
    right: 10.53%;
  }
  label{
    margin: rem(40) 8% rem(82) 8%;
    display: block;
    font-size: rem(23);
    color: #999;
  }
  label span{
    color: #4ba6fe;
  }
  .check{
    -webkit-appearance: none;
    display: none;
  }
  .check+span{
    width: rem(34);
    height: rem(34);
    display: inline-block;
    background: url(../assets/checked.png) no-repeat;
    background-size: 100%;
    position: relative;
    top:rem(8);
}
  .check:checked+span{
    width: rem(34);
    height: rem(34);
    display: inline-block;
    background: url(../assets/icons.png) no-repeat;
  }
button{
  width:74.4%;
  height: rem(81);
  margin:0 12.8%;
  background:#3d9dfc ;
  text-align: center;
  font-size: rem(32);
  color: #fff;
  border-radius: 38px;
  border:none;
  outline: none;
  display:block;
}
</style>
